using Android.App;
using Android.OS;
using Android.Views;
using Bulb.Core.ViewModels;
using Cirrious.MvvmCross.Droid.Views;
using MyAndroid = Android;

namespace Bulb.UI.Android.Views
{
    [Activity(Label = "Home")]
    public class HomeView : MvxActivity
    {
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.HomeView);
        }

        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            menu.Add(0, 1, 1, "Settings");
            return true;
        }

        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
                case 1:
                    ((HomeViewModel)ViewModel).SettingsCommand.Execute(null);
                    return true;
                default:
                    return base.OnOptionsItemSelected(item);
            }
        }
    }
}